package com.study.d4_thread;

public class Test2 {
    public static void main(String[] args) {
        //目标：掌握多线程的创建方式二：实现Runnable接口
        Runnable target = new MyRunnable();
        Thread t = new Thread(target,"嘿嘿");
        System.out.println(t.getName());
        t.start();
        for (int i = 0; i < 4; i++) {
            System.out.println("main："+i);
        }
    }
}
class MyRunnable implements Runnable{

    @Override
    public void run() {
        for (int i = 0; i < 4; i++) {
            System.out.println("son:"+i);
        }
    }
}